﻿package
{
	import com.controller.OverCommand;
	import com.controller.StartupCommand;
	
	import org.puremvc.as3.interfaces.IFacade;
	import org.puremvc.as3.patterns.facade.Facade;
	
	public class ApplicationFacade extends Facade implements IFacade
	{
		public static const STARTUP:String = "startup";
		public static const OVERSTARTUP:String = "overStartup";
		public function ApplicationFacade()
		{
			super();
		}
		public static function getInstance():ApplicationFacade{
			if(instance==null){
				instance=new ApplicationFacade();
			}
			return instance as ApplicationFacade;
		}
		override protected function initializeController():void{
			super.initializeController();
		 	registerCommand(STARTUP, StartupCommand);
			registerCommand(OVERSTARTUP, OverCommand);
		}
		/**
		 *发送startup通告，并将舞台作为参数传递 
		 * @param app
		 * 
		 */		
		public function startup(app:Object):void{
			sendNotification(STARTUP,app);
		}
	}
}